#include "aboutdialog.h"
#include "ui_aboutdialog.h"

AboutDialog::AboutDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AboutDialog)
{
    ui->setupUi(this);
    setWindowTitle(tr("关于"));

    // 设置窗口属性
    setFixedSize(400, 300);
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
}

void AboutDialog::setAppInfo(const QString &name, const QString &version, const QString &copyright) {
    ui->titleLabel->setText(name);
    // ui->versionLabel->setText(tr("版本: ") + version);
    // ui->copyrightLabel->setText(copyright);

    // 设置图标（如果有）
    ui->iconLabel->setPixmap(QPixmap(":/icons/app.png").scaled(64, 64, Qt::KeepAspectRatio));

    // 设置描述文本
    ui->infoTextEdit->setText(tr(
        "这是一个基于Qt开发的记事本应用"
        ));
}

AboutDialog::~AboutDialog() {
    delete ui;
}
